<template>
	<mu-container class="form_container">
		<div class="amount">
		办理费用：￥{{orderinfo.amount}}
		</div>
		<mu-paper class="demo-paper paper_size" :z-depth="1">
			<h4>办理进度</h4>
			<mu-divider></mu-divider>
			<van-steps direction="vertical" :active="index">
				<van-step v-for="(item,index) in orderplans" :key="index">
				<h3>{{item.nodename}}</h3>
				<p>{{item.nodetime}}</p>
				</van-step>
			</van-steps>
		</mu-paper>
		<mu-paper class="demo-paper paper_size" :z-depth="1">
			<h4>保函信息</h4>
			<mu-divider></mu-divider>
			<p>受益人：{{orderinfo.tenderee}}</p>
			<p>被保证人：{{orderinfo.bidder}}</p>
			<p>项目名称：{{orderinfo.bidsection}}</p>
			<p>担保金额：{{orderinfo.earnest}}</p>
			<p>保函有效截止日期：{{orderinfo.enddate}}</p>
		</mu-paper>
		<mu-paper class="demo-paper paper_size" :z-depth="1">
			<h4>提供资料</h4>
			<mu-divider></mu-divider>
			<p v-for="(item,index) in filelist" :key="index">
				<a href="#" @click="viewFile(item)">{{item.filename}}</a>
			</p>
		</mu-paper>
	</mu-container>
</template>

<script>
	import {
		ImagePreview
	} from 'vant';
	export default {
		data() {
			return {
				filelist: [],
				orderinfo: {},
				orderplans: [],
				index: '0'
			}
		},
		mounted() {
			let _this = this;
			let rowguid = this.$route.query.rowguid;
			this.$api.orderdetail({
				rowguid: rowguid
			}).then(function (res) {
				_this.filelist = res.orderfile;
				_this.orderinfo = res.orderinfo;
				_this.orderplans = res.orderplanned;
				_this.index = res.orderplanned.length - 1;

				_this.$api.mycoupon({
					orderamount: res.orderinfo.amount,
					bidsection: res.orderinfo.bidsection,
					vendorid: res.orderinfo.vendorid,
				}).then(function (data) {
					_this.couponlist = data;
				})
			})
		},
		methods: {
			viewFile(item) {
				if (item.filename != '招标文件') {
					ImagePreview([
						item.fileurl
					]);
				}

			}
		}
	}
</script>

<style lang="less" scoped>
	.amount{
		height: 100px;
		line-height: 100px;
		font-size: 18px;
		font-weight: bold;
		background-color: white;
		margin-top: 10px;
		text-indent: 1em;
		color:rgb(241, 130, 65);
	}

	.demo-paper {
		margin: 10px 0;
		padding: 15px;
		color: #524949
	}

	p {
		margin: 7px 0
	}

	a {
		color: #4a75ec
	}

	h3 {
		margin: 0;
		font-size: 14px;
		font-weight: normal;
	}

	h4 {
		font-size: 16px;
		margin: 10px 0;
	}
	.mu-elevation-1{
		box-shadow: none;
	}
</style>